import React from "react";
import Select from 'antd/lib/select';
import Cascader from 'antd/lib/cascader';
import Col from 'antd/lib/col';
import Row from 'antd/lib/row';
import Input from 'antd/lib/input';
import Radio from "antd/lib/radio";
import Collapse from 'antd/lib/collapse';
import TreeSelect from 'antd/lib/tree-select';
import notification from "@/services/notification";
import 'antd/dist/antd.less'
import moment from "moment";
import DatePicker from "antd/lib/date-picker";
import locale from 'antd/es/date-picker/locale/zh_CN';
import { currentUser } from "@/services/auth";
import GlobalFunctions from '@/store/globalFunctions';
import { inject, observer } from 'mobx-react';
const { Panel } = Collapse;

class EmployeeTable extends React.Component {
  state = {
    sexdata: [{ id: "男", name: "男" }, { id: "女", name: "女" }],
    threepersondata: [{ id: "A", name: "A" }, { id: "B", name: "B" }, { id: "C", name: "C" }, { id: "无", name: "无" }],
    socialsecuritydata: [{ id: 1, name: "有" }, { id: 0, name: "无" }],
    biddingexitdata: [{ id: "是", name: "是" }, { id: "否", name: "否" }],
    periodunitdata: [{ id: "年", name: "年" }, { id: "半年", name: "半年" }, { id: "月", name: "月" }],
    schooleddata: [{ id: "大专", name: "大专" }, { id: "本科", name: "本科" }, { id: "硕士", name: "硕士" }, { id: "博士", name: "博士" },
    { id: "博士后", name: "博士后" }, { id: "高中", name: "高中" }, { id: "职高", name: "职高" }, { id: "初中", name: "初中" }],
    certificatestatusdata: [{ id: "初始注册", name: "初始注册" }, { id: "转注册", name: "转注册" }],
  };
  componentWillMount() {
  }
  componentDidMount() {
  }
  cascaderonChange = value => {
    this.props.employeeStore.employeeModel.setLocation(value);
  }
  certificatelenChange = e => {
    if (e.target.value > 6) {
      notification.error("证书数量不能超过6");
      return;
    }
    this.props.employeeStore.employeeModel.setCertificatelen(e.target.value);
  }
  fieldedit(field) {
    if (field === 'maintainer' && this.props.employeeStore.employeeModel.openseapool === 0 && this.props.employeeStore.employeeModel.ifproject === 0) {
      return true
    }
    if (!this.props.employeeStore.employeeModel.isedit) {
      return true;
    }
    if (this.props.employeeStore.employeeModel.colcontrol) {
      if (this.props.employeeStore.employeeModel.allow_col.indexOf(field) >= 0) {
        return false;
      } else {
        return true;
      }
    } else {
      return false;
    }
  }


  periodsChange = (e) => {
    let value = e.target.value;
    if (GlobalFunctions.isEmptyobj(value) || GlobalFunctions.isEmptyobj(this.props.employeeStore.employeeModel.signingtime)) {
      this.props.employeeStore.employeeModel.setPeriods(value);
    } else {
      let expirationtime = moment(GlobalFunctions.getAppointedDate(this.props.employeeStore.employeeModel.periodunit, value, this.props.employeeStore.employeeModel.signingtime));
      this.props.employeeStore.employeeModel.setPeriods(value);
      this.props.employeeStore.employeeModel.setExpirationtime(expirationtime);
    }
  }
  signingtimechange = value => {
    if (GlobalFunctions.isEmptyobj(value)) {
      this.props.employeeStore.employeeModel.setSigningtime(value);
    } else {
      let expirationtime = moment(GlobalFunctions.getAppointedDate(this.props.employeeStore.employeeModel.periodunit, this.props.employeeStore.employeeModel.periods, value));
      this.props.employeeStore.employeeModel.setSigningtime(value);
      this.props.employeeStore.employeeModel.setExpirationtime(expirationtime);
    }
  }
  openshowchange = (e) => {
    this.props.employeeStore.employeeModel.setOpenshow(e.target.value);
  };
  bytstatuschange = (value) => {
    this.props.employeeStore.employeeModel.setBytstatus(value);
    if(value === "签约") {
      if(this.props.employeeStore.employeeModel.contractcode === ""){
        this.props.employeeStore.employeeModel.setContractcode(this.props.employeeStore.employeeModel.code);
      }
      if(this.props.employeeStore.employeeModel.signatory === ""){
        this.props.employeeStore.employeeModel.setSignatory(currentUser.id);
      }
    }
  }
  render() {
    return (
      <div>
        <Collapse defaultActiveKey={['1']} >
          <Panel header="基本情况" key="1">
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                <span style={{ color: '#f81d22', fontSize: 12 }}>*</span>编码:</div></Col>
              <Col span={6}>
                <Input
                  value={this.props.employeeStore.employeeModel.code}
                  style={{ width: "100%" }}
                  onChange={e => this.props.employeeStore.employeeModel.setCode(e.target.value)}
                  placeholder="编码"
                  disabled={this.fieldedit("code")}
                  autoFocus
                />
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                联系人:</div></Col>
              <Col span={6}>
                <Input
                  value={this.props.employeeStore.employeeModel.contacts}
                  style={{ width: "100%" }}
                  onChange={e => this.props.employeeStore.employeeModel.setContacts(e.target.value)}
                  disabled={this.fieldedit("contacts")}
                  placeholder="联系人"
                />
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
              联系方式:</div></Col>
              <Col span={6}>
                <Input
                  value={this.props.employeeStore.employeeModel.contactsmobile}
                  style={{ width: "100%" }}
                  onChange={e => this.props.employeeStore.employeeModel.setContactsmobile(e.target.value)}
                  disabled={this.fieldedit("contactsmobile")}
                  placeholder="联系方式"
                />
              </Col>
            </Row>
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                <span style={{ color: '#f81d22', fontSize: 12 }}>*</span>姓名:</div></Col>
              <Col span={6}>
                <Input
                  value={this.props.employeeStore.employeeModel.name}
                  style={{ width: "100%" }}
                  onChange={e => this.props.employeeStore.employeeModel.setName(e.target.value)}
                  disabled={this.fieldedit("name")}
                  placeholder="姓名"
                />
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                身份证号:</div></Col>
              <Col span={6}>
                <Input
                  value={this.props.employeeStore.employeeModel.idcard}
                  style={{ width: "100%" }}
                  onChange={e => this.props.employeeStore.employeeModel.setIdcard(e.target.value)}
                  placeholder="身份证号"
                  disabled={this.fieldedit("idcard")}
                  autoFocus
                />
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                <span style={{ color: '#f81d22', fontSize: 12 }}>*</span>手机号:</div></Col>
              <Col span={6}>
                <Input
                  value={this.props.employeeStore.employeeModel.mobile}
                  style={{ width: "100%" }}
                  onChange={e => this.props.employeeStore.employeeModel.setMobile(e.target.value)}
                  placeholder="手机号"
                  disabled={this.fieldedit("mobile")}
                  autoFocus
                />
              </Col>
            </Row>
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                微信:</div></Col>
              <Col span={6}>
                <Input
                  value={this.props.employeeStore.employeeModel.wechat}
                  style={{ width: "100%" }}
                  onChange={e => this.props.employeeStore.employeeModel.setWechat(e.target.value)}
                  placeholder="微信"
                  disabled={this.fieldedit("wechat")}
                  autoFocus
                />
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                <span style={{ color: '#f81d22', fontSize: 12 }}>*</span>性别:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  disabled={this.fieldedit("sex")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.sex}
                  onChange={value =>this.props.employeeStore.employeeModel.setSex(value)} >
                  {(this.state.sexdata || []).map(item => (
                    <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
                  ))}
                </Select>
              </Col>
            </Row>
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                证书:</div></Col>
              <Col span={6}>
                <Cascader options={this.props.employeecertificatedata}
                  value={this.props.employeeStore.employeeModel.certificate1} style={{ width: "80%" }}
                  onChange={value =>this.props.employeeStore.employeeModel.setCertificate1(value) }
                  disabled={this.fieldedit("certificate")}
                  placeholder="请选择"
                  maxTagCount="responsive"
                />
                <Input
                  style={{ width: "18%" }}
                  value={this.props.employeeStore.employeeModel.certificatelen}
                  onChange={this.certificatelenChange}
                  placeholder="数量"
                  onkeyup="this.value=this.value.replace(/\D/g,'')"
                  onafterpaste="this.value=this.value.replace(/\D/g,'')"
                  type="number"
                  disabled={this.fieldedit("certificate")}
                />
                {this.props.employeeStore.employeeModel.certificatelen > 1 && (<Cascader options={this.props.employeecertificatedata}
                  value={this.props.employeeStore.employeeModel.certificate2} style={{ width: "100%" }}
                  onChange={value =>this.props.employeeStore.employeeModel.setCertificate2(value)}
                  disabled={this.fieldedit("certificate")}
                  placeholder="请选择"
                  maxTagCount="responsive"
                />)}
                {this.props.employeeStore.employeeModel.certificatelen > 2 && (<Cascader options={this.props.employeecertificatedata}
                  value={this.props.employeeStore.employeeModel.certificate3} style={{ width: "100%" }}
                  onChange={value => this.props.employeeStore.employeeModel.setCertificate3(value)}
                  disabled={this.fieldedit("certificate")}
                  placeholder="请选择"
                  maxTagCount="responsive"
                />)}
                {this.props.employeeStore.employeeModel.certificatelen > 3 && (<Cascader options={this.props.employeecertificatedata}
                  value={this.props.employeeStore.employeeModel.certificate4} style={{ width: "100%" }}
                  onChange={value => this.props.employeeStore.employeeModel.setCertificate4(value)}
                  disabled={this.fieldedit("certificate")}
                  maxTagCount="responsive"
                />)}
                {this.props.employeeStore.employeeModel.certificatelen > 4 && (<Cascader options={this.props.employeecertificatedata}
                  value={this.props.employeeStore.employeeModel.certificate5} style={{ width: "100%" }}
                  onChange={value => this.props.employeeStore.employeeModel.setCertificate5(value)}
                  disabled={this.fieldedit("certificate")}
                  placeholder="请选择"
                  maxTagCount="responsive"
                />)}
                {this.props.employeeStore.employeeModel.certificatelen > 5 && (<Cascader options={this.props.employeecertificatedata}
                  value={this.props.employeeStore.employeeModel.certificate6} style={{ width: "100%" }}
                  onChange={value => this.props.employeeStore.employeeModel.setCertificate6(value)}
                  disabled={this.fieldedit("certificate")}
                  placeholder="请选择"
                  maxTagCount="responsive"
                />)}
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                地区:</div></Col>
              <Col span={6}>
                <TreeSelect
                  showSearch
                  disabled={this.fieldedit("location")}
                  style={{ width: "100%" }}
                  value={this.props.employeeStore.employeeModel.location}
                  dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
                  placeholder="请选择"
                  allowClear
                  treeData={this.props.employeeareadata}
                  onChange={this.cascaderonChange}
                />
              </Col>
            </Row>
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                社保情况:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  disabled={this.fieldedit("socialsecurity")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.socialsecurity}
                  onChange={value => this.props.employeeStore.employeeModel.setSocialsecurity(value)} >
                  {(this.state.socialsecuritydata || []).map(item => (
                    <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
                  ))}
                </Select>
              </Col>

              {this.props.employeeStore.employeeModel.socialsecurity === 1 && (<Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                社保地区:</div></Col>)}
              {this.props.employeeStore.employeeModel.socialsecurity === 1 && (<Col span={6}>
                <TreeSelect
                  showSearch
                  disabled={this.fieldedit("area")}
                  style={{ width: "100%" }}
                  value={this.props.employeeStore.employeeModel.area}
                  dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
                  placeholder="请选择"
                  allowClear
                  treeData={this.props.employeeareadata}
                  onChange={value => this.props.employeeStore.employeeModel.setArea(value) }
                />
              </Col>)}
            </Row>
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                所属部门:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.orgunitid}
                  onChange={value =>  this.props.employeeStore.employeeModel.setOrgunitid(value) }
                  disabled={this.fieldedit("orgunitid")}>
                  {(this.props.orgunitdata || []).map(item => (
                    <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
                  ))}
                </Select>
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                维护人:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  allowClear
                  disabled={this.fieldedit("maintainer")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.maintainer}
                  onChange={value =>  this.props.employeeStore.employeeModel.setMaintainer(value)} >
                  {(this.props.employeeuserdata || []).map(item => (
                    <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
                  ))}
                </Select>
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                录入人:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  allowClear
                  disabled={true}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.userid}
                  onChange={value => this.props.employeeStore.employeeModel.setUserid(value)} >
                  {(this.props.employeeuserdata || []).map(item => (
                    <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
                  ))}
                </Select>
              </Col>
            </Row>
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                <span style={{ color: '#f81d22', fontSize: 12 }}>*</span>状态:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  disabled={this.fieldedit("bytstatus")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.bytstatus}
                  onChange={this.bytstatuschange} >
                  {(this.props.employeestatusdata || []).map(item => (
                    <Select.Option key={item.value} value={item.value}>{item.label}</Select.Option>
                  ))}
                </Select>
              </Col>
              {this.props.openseapool === 0 && (<><Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                是否公开:</div></Col>
                <Col span={6}>
                  <Radio.Group onChange={this.openshowchange}
                    style={{ width: "100%" }}
                    value={this.props.employeeStore.employeeModel.openshow}>
                    <Radio value={0}>不公开</Radio>
                    <Radio value={1}>公开</Radio>
                  </Radio.Group>
                </Col></>)}
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                证书状态:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  disabled={this.fieldedit("certificatestatus")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.certificatestatus}
                  onChange={value =>  this.props.employeeStore.employeeModel.setCertificatestatus(value) } >
                  {(this.state.certificatestatusdata || []).map(item => (
                    <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
                  ))}
                </Select>
              </Col>
            </Row>
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                备注:</div></Col>
              <Col span={6}>
                <textarea
                  rows="3" cols="50"
                  textalignvertical="top"
                  height="100px"
                  value={this.props.employeeStore.employeeModel.message}
                  onChange={e => this.props.employeeStore.employeeModel.setMessage( e.target.value) }
                  placeholder="备注"
                  disabled={this.fieldedit("message")}
                />
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                三类人员:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  disabled={this.fieldedit("threeperson")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.threeperson}
                  onChange={value => this.props.employeeStore.employeeModel.setThreeperson( value) } >
                  {(this.state.threepersondata || []).map(item => (
                    <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
                  ))}
                </Select>
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                招标出场:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  disabled={this.fieldedit("biddingexit")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.biddingexit}
                  onChange={value => this.props.employeeStore.employeeModel.setBiddingexit( value) } >
                  {(this.state.biddingexitdata || []).map(item => (
                    <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
                  ))}
                </Select>
              </Col>
            </Row>
          </Panel>
          <Panel header="其它信息" key="2">
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                毕业专业:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  mode="multiple"
                  allowClear
                  disabled={this.fieldedit("major")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.major}
                  onChange={value =>  this.props.employeeStore.employeeModel.setMajor( value) } >
                  {(this.props.employeemajordata || []).map(item => (
                    <Select.Option key={item.value} value={item.value}>{item.label}</Select.Option>
                  ))}
                </Select>
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                学历:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  allowClear
                  disabled={this.fieldedit("schooled")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.schooled}
                  onChange={value => this.props.employeeStore.employeeModel.setSchooled( value) } >
                  {(this.state.schooleddata || []).map(item => (
                    <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
                  ))}
                </Select>
              </Col>
            </Row>

          </Panel>
          <Panel header="订单信息" key="3">
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                户名:</div></Col>
              <Col span={6}>
                <Input
                  value={this.props.employeeStore.employeeModel.accountname}
                  style={{ width: "100%" }}
                  onChange={e => this.props.employeeStore.employeeModel.setAccountname( e.target.value )}
                  disabled={this.fieldedit("accountname")}
                  placeholder="户名"
                />
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                账户:</div></Col>
              <Col span={6}>
                <Input
                  value={this.props.employeeStore.employeeModel.accountcode}
                  style={{ width: "100%" }}
                  onChange={e => this.props.employeeStore.employeeModel.setAccountcode( e.target.value ) }
                  disabled={this.fieldedit("accountcode")}
                  placeholder="账户"
                />
              </Col>

              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                开户银行:</div></Col>
              <Col span={6}>
                <Input
                  value={this.props.employeeStore.employeeModel.accountbank}
                  style={{ width: "100%" }}
                  onChange={e => this.props.employeeStore.employeeModel.setAccountbank( e.target.value ) }
                  placeholder="开户银行"
                  disabled={this.fieldedit("accountbank")}
                  autoFocus
                />
              </Col>
            </Row>

            <Row style={{ marginBottom: 5 }}>
              {/* <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                预计金额:</div></Col>
              <Col span={6}>
                <Input
                  style={{ width: "100%" }}
                  value={this.props.employeeStore.employeeModel.price}
                  onChange={e => this.setState({ price: e.target.value })}
                  placeholder="预计金额(¥)"
                  onkeyup="this.value=this.value.replace(/\D/g,'')"
                  onafterpaste="this.value=this.value.replace(/\D/g,'')"
                  type="number"
                  disabled={this.fieldedit("price")}
                />
              </Col> */}
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                金额:</div></Col>
              <Col span={6}>
                <Input
                  style={{ width: "100%" }}
                  value={this.props.employeeStore.employeeModel.signamount}
                  onChange={e =>  this.props.employeeStore.employeeModel.setSignamount( e.target.value ) }
                  placeholder="金额(¥)"
                  onkeyup="this.value=this.value.replace(/\D/g,'')"
                  onafterpaste="this.value=this.value.replace(/\D/g,'')"
                  type="number"
                  disabled={this.fieldedit("signamount")}
                />
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                定金:</div></Col>
              <Col span={6}>
                <Input
                  style={{ width: "100%" }}
                  value={this.props.employeeStore.employeeModel.frontmoney}
                  onChange={e => this.props.employeeStore.employeeModel.setFrontmoney( e.target.value )}
                  placeholder="定金(¥)"
                  onkeyup="this.value=this.value.replace(/\D/g,'')"
                  onafterpaste="this.value=this.value.replace(/\D/g,'')"
                  type="number"
                  disabled={this.fieldedit("frontmoney")}
                />
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                信息费:</div></Col>
              <Col span={6}>
                <Input
                  style={{ width: "100%" }}
                  value={this.props.employeeStore.employeeModel.informationfee}
                  onChange={e =>  this.props.employeeStore.employeeModel.setInformationfee( e.target.value )}
                  placeholder="信息费(¥)"
                  onkeyup="this.value=this.value.replace(/\D/g,'')"
                  onafterpaste="this.value=this.value.replace(/\D/g,'')"
                  type="number"
                  disabled={this.fieldedit("informationfee")}
                />
              </Col>
            </Row>
            <Row style={{ marginBottom: 5 }}>

              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                合同编号:</div></Col>
              <Col span={6}>
                <Input
                  value={this.props.employeeStore.employeeModel.contractcode}
                  style={{ width: "100%" }}
                  onChange={e =>  this.props.employeeStore.employeeModel.setContractcode( e.target.value ) }
                  disabled={this.fieldedit("contractcode")}
                  placeholder="合同编号"
                />
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                签约人:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  disabled={this.fieldedit("signatory")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.signatory}
                  onChange={value => this.props.employeeStore.employeeModel.setSignatory( value )} >
                  {(this.props.employeeuserdata || []).map(item => (
                    <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
                  ))}
                </Select>
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                签约类型:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  allowClear
                  disabled={this.fieldedit("contracttype")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.contracttype}
                  onChange={value => this.props.employeeStore.employeeModel.setContracttype( value ) } >
                  {(this.props.employeecontracttypedata || []).map(item => (
                    <Select.Option key={item.value} value={item.value}>{item.label}</Select.Option>
                  ))}
                </Select>
              </Col>
            </Row>
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                期限单位:</div></Col>
              <Col span={6}>
                <Select style={{ width: "100%" }}
                  showSearch
                  disabled={this.fieldedit("periodunit")}
                  optionFilterProp="children"
                  value={this.props.employeeStore.employeeModel.periodunit}
                  onChange={value => this.props.employeeStore.employeeModel.setPeriodunit( value ) } >
                  {(this.state.periodunitdata || []).map(item => (
                    <Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
                  ))}
                </Select>
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>
                期限:</div></Col>
              <Col span={6}>
                <Input
                  style={{ width: "100%" }}
                  value={this.props.employeeStore.employeeModel.periods}
                  onChange={this.periodsChange}
                  placeholder="期限(¥)"
                  onkeyup="this.value=this.value.replace(/\D/g,'')"
                  onafterpaste="this.value=this.value.replace(/\D/g,'')"
                  type="number"
                  disabled={this.fieldedit("periods")}
                />
              </Col>
            </Row>
            <Row style={{ marginBottom: 5 }}>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>签约时间:</div></Col>
              <Col span={6}>
                <DatePicker
                  locale={locale}
                  style={{ width: "100%" }}
                  disabled={this.fieldedit("signingtime")}
                  value={this.props.employeeStore.employeeModel.signingtime}
                  onChange={this.signingtimechange}
                  placeholder="签约时间"
                />
              </Col>
              <Col span={2}><div style={{ marginTop: "5px", textAlign: "right", marginRight: "10px" }}>到期时间:</div></Col>
              <Col span={6}>
                <DatePicker
                  locale={locale}
                  style={{ width: "100%" }}
                  disabled={this.fieldedit("expirationtime")}
                  value={this.props.employeeStore.employeeModel.expirationtime}
                  onChange={value => this.props.employeeStore.employeeModel.setExpirationtime(value) }
                  placeholder="到期时间"
                />
              </Col>
            </Row>
          </Panel>
        </Collapse>
      </div>
    );
  };
}
export default inject('employeeStore')(observer(EmployeeTable));